﻿<UserControl x:Class="VSMantisConnect.Views.IssueDetail"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:VSMantisConnect.Views"
			 xmlns:ui="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.14.0"
			 xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
	<DockPanel LastChildFill="True">
		<TextBox x:Name="tbxNewNote" AcceptsReturn="True" AcceptsTab="True" DockPanel.Dock="Top" MinLines="3" SpellCheck.IsEnabled="True" Foreground="{DynamicResource {x:Static ui:VsBrushes.InfoTextKey}}" Background="{DynamicResource {x:Static ui:VsBrushes.InfoBackgroundKey}}" />
		<WrapPanel DockPanel.Dock="Top" Margin="2">
			<Button x:Name="btnAddNote" IsEnabled="False" Click="btnAddNote_Click" Content="#Add note#" DockPanel.Dock="Top" Style="{DynamicResource {x:Static ui:VsResourceKeys.ButtonStyleKey}}" />
		</WrapPanel>
		<ListBox DockPanel.Dock="Top"  Name="lstIssueDetail" ItemsSource="{Binding}" AlternationCount="2" ScrollViewer.CanContentScroll="False" Style="{DynamicResource {x:Static ui:VsResourceKeys.ThemedDialogListBoxStyleKey}}">
			<ListBox.Resources>
				<Style TargetType="ListBoxItem">
					<Style.Triggers>
						<Trigger Property="ItemsControl.AlternationIndex" Value="1">
							<Setter Property="Background" Value="{DynamicResource {x:Static ui:VsBrushes.ComboBoxDisabledBackgroundKey}}" />
						</Trigger>
						<Trigger Property="ItemsControl.AlternationIndex" Value="0">
							<Setter Property="Background" Value="{DynamicResource {x:Static ui:VsBrushes.ComboBoxBackgroundKey}}"  />
						</Trigger>
					</Style.Triggers>
				</Style>
			</ListBox.Resources>
			<ListBox.ItemTemplate>
				<DataTemplate DataType="mdl:IssueNoteData">
					<StackPanel HorizontalAlignment="Stretch">
						<Label  Style="{DynamicResource {x:Static ui:VsResourceKeys.ThemedDialogLabelStyleKey}}">
							<TextBlock Text="{Binding date_submitted, StringFormat=\{0:D\} à \{0:t\}, ConverterCulture=fr-FR}" />
						</Label>
						<StackPanel Orientation="Horizontal">
							<Label Content="Rapporteur : " Style="{DynamicResource {x:Static ui:VsResourceKeys.ThemedDialogLabelStyleKey}}"/>
							<Label Content="{Binding reporter.name, StringFormat={}{0}}" Style="{DynamicResource {x:Static ui:VsResourceKeys.ThemedDialogLabelStyleKey}}"/>
						</StackPanel>
						<Label Content="{Binding text, StringFormat={}Note : {0}}" Style="{DynamicResource {x:Static ui:VsResourceKeys.ThemedDialogLabelStyleKey}}"/>
					</StackPanel>
				</DataTemplate>
			</ListBox.ItemTemplate>
		</ListBox>
	</DockPanel>
</UserControl>
